package entity;

import util.StringUtil;

import java.io.Serializable;
import java.util.Arrays;

/**
 * @Author:石小俊
 * @Date:2022/12/12 14:11
 * @Version:1.0-SNAPSHOT
 * @Description:
 */
public class Emp implements Serializable {

    private Integer id;
    private String name;
    private Double salary;
    private String gender;
    private String edu;
    private String[] hobbies;
    private Dept dept;

    @Override
    public String toString() {
        return "Emp{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", salary=" + salary +
                ", gender='" + gender + '\'' +
                ", edu='" + edu + '\'' +
                ", hobbies=" + Arrays.toString(hobbies) +
                ", dept=" + dept +
                '}';
    }

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    public void setHob(String hobbies){
        if(!StringUtil.isNull(hobbies)){
            this.hobbies = hobbies.split(",");
        }
    }

    public String getHob(){
        return StringUtil.arrayToString(hobbies);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getSalary() {
        return salary;
    }

    public void setSalary(Double salary) {
        this.salary = salary;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getEdu() {
        return edu;
    }

    public void setEdu(String edu) {
        this.edu = edu;
    }

    public String[] getHobbies() {
        return hobbies;
    }

    public void setHobbies(String[] hobbies) {
        this.hobbies = hobbies;
    }
}
